function getEl(Element) {
    return document.querySelector(Element)
}

function getAllEl(Element) {
    return document.querySelectorAll(Element)
}

function ready(callback) {
    document.addEventListener('DOMContentLoaded', function () {
        callback()
    })
}


function Foot(nav) {
    getEl('footer').innerHTML = `
    <ul>
    <li>
        <a href="first.html" class="${nav=='home'?'active':''}">
            <i class="iconfont icon-home"></i>
            <span>首页</span>
        </a>
    </li>
    <li>
        <a href="sport.html"class="${nav=='sport'?'active':''}">
            <i class="iconfont icon-sports"></i>
            <span>运动</span>
        </a>
    </li>
    <li>
        <a href="cricle.html"class="${nav=='cricle'?'active':''}">
            <i class="iconfont icon-calorie"></i>
            <span>圈子</span>
        </a>
    </li>
    <li>
        <a href="my.html"class="${nav=='my'?'active':''}">
            <i class="iconfont icon-mine"></i>
            <span>我的</span>
        </a>
    </li>
</ul>
    `
}

module.exports = {
    getEl,
    getAllEl,
    ready,
    Foot
}